import store from '@/store'

export const imgerror = {
  inserted: function(el, options) {
    console.log('el', el)
    console.log('options', options)
    el.onerror = () => {
      console.log('图片加载失败')
      el.src = options.value
    }
  }
}

export const allow = {
  inserted: function(el, options) {
    const points = store.state.user.userInfo.roles.points
    if (!points.includes(options.value)) {
      el.style.display = 'none'
    }
  }
}
